<?php
namespace app\stores\model\order;
use app\common\model\CommonModel;
use think\facade\Db;

class LevelOrderModel extends CommonModel{
    protected  $name = 'beautiful_level_order';
    protected  $pk   = 'order_id';
    protected $type=[
        'pay_info' => 'array',
    ];

    /**
     * 模型写入前事件（钩子函数）
     */
    public static function onBeforeInsert($model)
    {
        $model->set("add_time", date('Y-m-d H:i:s'));
        $model->set("add_ip", request()->ip());
    }
}
